// Library Testing.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int unit0()
{
	// How to test for memory leaks ??? 
	t_MessageQueue* p_MessageQueue = new(t_MessageQueue);
	delete p_MessageQueue;
	return 1;
}

int unit1()
{
	return 1;
}

int (*proc[])() =
{
	unit0,
	unit1
	//unit1;
};


/* For future usage - test cases with description */
typedef int (*testfunction)(); 

typedef struct tmpTestUnit 
{
	char *description;
	testfunction proc;
} TestUnit;

//int unit

// array of test units
// class - test unit; array of test units

int _tmain(int argc, _TCHAR* argv[])
{
	int failed = 0;

	for (int i = 0; i < (sizeof(proc) / sizeof(proc[0])); i++)
	{
		if (proc[i]() == 1)
			printf("Unit%d - pass\n");
		else
		{
			printf("Unit%d - FAIL\n");
			failed++;
		}
	}

	printf("Failed: %d\n", failed);
	return 0;
}

